package com.example.demo.entity;

import javax.persistence.*;

@Entity
@Table(name = "tb_consultant", uniqueConstraints = {
        @UniqueConstraint(columnNames = "phone_number")
})
public class Consultant {
    @Id
    @Column(name = "id", updatable = false, nullable = false)
    private String id;

    @Column(name = "name", length = 64, nullable = false)
    private String name;

    @Column(name = "phone_number", length = 16, nullable = false)
    private String phoneNumber;

    @Column(name = "total_minutes", nullable = false)
    private String totalMinutes;

    @Column(name = "evaluation")
    private String evaluation;

    @Column(name = "is_supervisor", nullable = false)
    private String isSupervisor;

    @Column(name = "schedule", length = 32)
    private String schedule;

    @Column(name = "password", length = 128)
    private String password;

    @Column(name = "title", length = 64)
    private String title;

    @Column(name = "company", length = 128)
    private String company;

    @Column(name = "gender", nullable = false)
    private String gender;

    @Column(name = "age")
    private Short age;

    @Column(name = "ID_No", length = 128)
    private String IDNo;

    @Column(name = "email", length = 32)
    private String email;

    // isBusy 不在表字段中，标识当前咨询师是否忙碌。
    @Transient
    private Boolean busy;

    public Consultant() {
    }

    public Consultant(String id, String name, String phoneNumber, String totalMinutes, String evaluation, String isSupervisor, String schedule, String password, String title, String company, String gender, Short age, String IDNo, String email) {
        this.id = id;
        this.name = name;
        this.phoneNumber = phoneNumber;
        this.totalMinutes = totalMinutes;
        this.evaluation = evaluation;
        this.isSupervisor = isSupervisor;
        this.schedule = schedule;
        this.password = password;
        this.title = title;
        this.company = company;
        this.gender = gender;
        this.age = age;
        this.IDNo = IDNo;
        this.email = email;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getTotalMinutes() {
        return totalMinutes;
    }

    public void setTotalMinutes(String totalMinutes) {
        this.totalMinutes = totalMinutes;
    }

    public String getEvaluation() {
        return evaluation;
    }

    public void setEvaluation(String evaluation) {
        this.evaluation = evaluation;
    }

    public String getSupervisor() {
        return isSupervisor;
    }

    public void setSupervisor(String supervisor) {
        isSupervisor = supervisor;
    }

    public String getSchedule() {
        return schedule;
    }

    public void setSchedule(String schedule) {
        this.schedule = schedule;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public Short getAge() {
        return age;
    }

    public void setAge(Short age) {
        this.age = age;
    }

    public String getIDNo() {
        return IDNo;
    }

    public void setIDNo(String IDNo) {
        this.IDNo = IDNo;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getIsSupervisor() {
        return isSupervisor;
    }

    public void setIsSupervisor(String isSupervisor) {
        this.isSupervisor = isSupervisor;
    }

    public Boolean getBusy() {
        return busy;
    }

    public void setBusy(Boolean busy) {
        busy = busy;
    }

    @Override
    public String toString() {
        return "Consultant{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", phoneNumber='" + phoneNumber + '\'' +
                ", totalMinutes=" + totalMinutes +
                ", evaluation=" + evaluation +
                ", isSupervisor=" + isSupervisor +
                ", schedule='" + schedule + '\'' +
                ", password='" + password + '\'' +
                ", title='" + title + '\'' +
                ", company='" + company + '\'' +
                ", gender=" + gender +
                ", age=" + age +
                ", IDNo='" + IDNo + '\'' +
                ", email='" + email + '\'' +
                '}';
    }
}
